const express = require('express');
const cros = require('cors');

const app = express();

app.get('/server/data',cros(), (req, res) => {
  res.json({
    code: 200,
    message: 'Hello World',
    data: [
        {name: 'f1'},
        {name: 'f2'},
        {name: 'f3'},
    ]
  })
});

const PORT = process.env.PORT || 3000

app.listen(PORT, () => {
  console.log('Server is running on port 3000');
});